/**
 */
package de.thwildau.tm.moses.asn1.asn1.impl;

import de.thwildau.tm.moses.asn1.asn1.Asn1Package;
import de.thwildau.tm.moses.asn1.asn1.RealSequenceValue;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Real Sequence Value</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.RealSequenceValueImpl#getMantissa <em>Mantissa</em>}</li>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.RealSequenceValueImpl#getBase <em>Base</em>}</li>
 *   <li>{@link de.thwildau.tm.moses.asn1.asn1.impl.RealSequenceValueImpl#getExponent <em>Exponent</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RealSequenceValueImpl extends MinimalEObjectImpl.Container implements RealSequenceValue
{
  /**
   * The default value of the '{@link #getMantissa() <em>Mantissa</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMantissa()
   * @generated
   * @ordered
   */
  protected static final long MANTISSA_EDEFAULT = 0L;

  /**
   * The cached value of the '{@link #getMantissa() <em>Mantissa</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMantissa()
   * @generated
   * @ordered
   */
  protected long mantissa = MANTISSA_EDEFAULT;

  /**
   * The default value of the '{@link #getBase() <em>Base</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBase()
   * @generated
   * @ordered
   */
  protected static final long BASE_EDEFAULT = 0L;

  /**
   * The cached value of the '{@link #getBase() <em>Base</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBase()
   * @generated
   * @ordered
   */
  protected long base = BASE_EDEFAULT;

  /**
   * The default value of the '{@link #getExponent() <em>Exponent</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExponent()
   * @generated
   * @ordered
   */
  protected static final long EXPONENT_EDEFAULT = 0L;

  /**
   * The cached value of the '{@link #getExponent() <em>Exponent</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getExponent()
   * @generated
   * @ordered
   */
  protected long exponent = EXPONENT_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected RealSequenceValueImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Asn1Package.Literals.REAL_SEQUENCE_VALUE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public long getMantissa()
  {
    return mantissa;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMantissa(long newMantissa)
  {
    long oldMantissa = mantissa;
    mantissa = newMantissa;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Asn1Package.REAL_SEQUENCE_VALUE__MANTISSA, oldMantissa, mantissa));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public long getBase()
  {
    return base;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBase(long newBase)
  {
    long oldBase = base;
    base = newBase;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Asn1Package.REAL_SEQUENCE_VALUE__BASE, oldBase, base));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public long getExponent()
  {
    return exponent;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setExponent(long newExponent)
  {
    long oldExponent = exponent;
    exponent = newExponent;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Asn1Package.REAL_SEQUENCE_VALUE__EXPONENT, oldExponent, exponent));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Asn1Package.REAL_SEQUENCE_VALUE__MANTISSA:
        return getMantissa();
      case Asn1Package.REAL_SEQUENCE_VALUE__BASE:
        return getBase();
      case Asn1Package.REAL_SEQUENCE_VALUE__EXPONENT:
        return getExponent();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Asn1Package.REAL_SEQUENCE_VALUE__MANTISSA:
        setMantissa((Long)newValue);
        return;
      case Asn1Package.REAL_SEQUENCE_VALUE__BASE:
        setBase((Long)newValue);
        return;
      case Asn1Package.REAL_SEQUENCE_VALUE__EXPONENT:
        setExponent((Long)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.REAL_SEQUENCE_VALUE__MANTISSA:
        setMantissa(MANTISSA_EDEFAULT);
        return;
      case Asn1Package.REAL_SEQUENCE_VALUE__BASE:
        setBase(BASE_EDEFAULT);
        return;
      case Asn1Package.REAL_SEQUENCE_VALUE__EXPONENT:
        setExponent(EXPONENT_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Asn1Package.REAL_SEQUENCE_VALUE__MANTISSA:
        return mantissa != MANTISSA_EDEFAULT;
      case Asn1Package.REAL_SEQUENCE_VALUE__BASE:
        return base != BASE_EDEFAULT;
      case Asn1Package.REAL_SEQUENCE_VALUE__EXPONENT:
        return exponent != EXPONENT_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (mantissa: ");
    result.append(mantissa);
    result.append(", base: ");
    result.append(base);
    result.append(", exponent: ");
    result.append(exponent);
    result.append(')');
    return result.toString();
  }

} //RealSequenceValueImpl
